package Scrap;

import java.util.Scanner;

public class demo09_splitstring_usingchar {

	
public static String reverseString(String original){
	
	String str1 = "";
	String str2 = "";
	boolean point_found = false;

	for (int i = 0; i < original.length(); i++) {
		char c = original.charAt(i);
		int I = c;
		if (((I >= 65 && I <= 90) || (I >= 97 && I <= 122) || (I >= 48 && I <= 57))
				&& point_found == false) {

			str1 = str1 + c;
		} else if (I == 46) {

			point_found = true;
		} else if (point_found == true
				&& ((I >= 65 && I <= 90) || (I >= 97 && I <= 122) || (I >= 48 && I <= 57))) {
			str2 = str2 + c;
		}
	}
return str2+"."+str1; 
	//System.out.println(str1+"  "+str2);	
	
}	
	
	
	public static void main(String[] args) {

		System.out.println("please enter a dot separated string");
		Scanner sc=new Scanner(System.in);
		String input=sc.nextLine();
		String reversed= reverseString(input);
		System.out.println(reversed);
		
	}

}
